﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using HienThi;

namespace BUS
{
    public class NhapHangBUS
    {
        public List<DonDatHang> LayBangDDH()
        {
            NhapHangDAO dao = new NhapHangDAO();
            return dao.LayBangDDH();
        }
        public List<NhapHangHienThi> LayBangNhapHangHienThi(string maddh)
        {
            NhapHangDAO dao = new NhapHangDAO();
            return dao.LayBangNhapHangHienThi(maddh);
        }
        public List<NhanVien> LayBangNhanVien()
        {
            NhapHangDAO dao = new NhapHangDAO();
            return dao.LayBangNhanVien();
        }
        public void InsertNhapHang(string maddh, string ngaynhap, string manv, int lannhap)
        {
            NhapHangDAO dao = new NhapHangDAO();
            dao.InsertNhapHang(maddh, ngaynhap, manv, lannhap);
        }
        public string LayLanNhap(string maddh)
        {
            NhapHangDAO dao = new NhapHangDAO();
            return dao.LayLanNhap(maddh);
        }
        public void InsertChiTietNH(string manh, string masp, string slnhan, string slconlai)
        {
            NhapHangDAO dao = new NhapHangDAO();
            dao.InsertChiTietNH(manh, masp, slnhan, slconlai);
        }
        public void UpdateDonDatHang(string maddh, string tinhtrang)
        {
            NhapHangDAO dao = new NhapHangDAO();
            dao.UpdateDonDatHang(maddh, tinhtrang);
        }
        public List<string> LayNgayNhapHang()
        {
            NhapHangDAO dao = new NhapHangDAO();
            return dao.LayNgayNhapHang();
        }
        public string LayMaNH(string maddh)
        {
            NhapHangDAO dao = new NhapHangDAO();
            return dao.LayMaNH(maddh);
        }
        public List<string> LayMaNH_Tim(string[] ngaynhap, string maddh)
        {
            NhapHangDAO dao = new NhapHangDAO();
            return dao.LayMaNH_Tim(ngaynhap, maddh);

        }

        public List<NhapHangHienThi> LayBangNhapHangHienThi_Tim(string manh)
        {
            NhapHangDAO dao = new NhapHangDAO();
            return dao.LayBangNhapHangHienThi_Tim(manh);
        }
        public void UpdateChiTietNH(string manh, string masp, int slnhan, int slconlai)
        {
            NhapHangDAO dao = new NhapHangDAO();
            dao.UpdateChiTietNH(manh, masp, slnhan, slconlai);
        }
        public bool KiemTraTinhTrangDDH(string maddh)
        {
            NhapHangDAO dao = new NhapHangDAO();
            return dao.KiemTraTinhTrangDDH(maddh);
        }
    
    }
}
